]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: don't forget to notify caller when failing to ensure actors
authorCosimo Cecchi <cosimo@endlesm.com>
Wed, 7 Jan 2015 09:53:30 +0000 (17:53 +0800)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 7 Jan 2015 23:26:21 +0000 (15:26 -0800)
The updateSearch() function is called in SearchResults every time new
search hits are available from a search provider; SearchResults will
wait for updateSearch() to complete in a callaback, to update the
overall progress of the search operation.

updateSearch() will call _ensureResultActors(), which will in turn call
getResultMetas() on the search provider, which is an operation that can
fail arbitrarily or return inconsistent data, as it's entirely in the
hands of the search provider.

In case _ensureResultActors() returns a failure, updateSearch() is
currently failing to notify the passed-in callback, which might leave
SearchResults in an inconsistent state: make sure the asynchronous flow
always ends up with a notification to the updateSearch() callback.

js/ui/search.js

index 2a8e0fd8ef1b9e9fc0e275f3cdd7d7c75e8ecfcb..d80fe63881c721a50c2cf3d730a9507da819bf79 100644 (file)
@@ -236,6 +236,7 @@ const SearchResultsBase = new Lang.Class({
             this._ensureResultActors(results, Lang.bind(this, function(successful) {
                 if (!successful) {
                     this._clearResultDisplay();
+                    callback();
                     return;
                 }